
import os

def search(key_word, path):
    with open(path, mode='r', encoding='utf-8') as f:
        if key_word in f.read():
            return True
    return False


base_dir = './data/'

files = [os.path.join(base_dir, file) for file in os.listdir(base_dir)]



# 使用方法
directory_path = './data/'

key_word = '好生意'
for file in files:
    if search(key_word, file):
        print(file)